/**
 * 定义分页全局变量
 */
var page_data_file = new page({search:searchFile,callback:funcDataFile});

$(document).ready(function(){
	setTimeout(function(){
		searchFile(page_data_file);
	}, 1000);

});


/**
 * 定义容器全局变量
 */
var con_data_file = new container({
	datagrid:'#tdata_filegrid',
	datagridtoolbar:'#tdata_filegrid-toolbar',
	singleSelect:true});

/**
 * 查询
 * @param page
 */
function searchFile(pg){
	if(pg == undefined || pg == null){
		pg = page_data_file;
	}
	var url = ctx + "/equipFileData/query";
	page_data_file.pageSize = pg.pageSize;
	page_data_file.pageNumber = pg.pageNumber;
	query(url, getDataFileCondition(), con_data_file, page_data_file);
}

/**
 * 获取查询条件
 * @returns {condition}
 */
function getDataFileCondition(){
	var dataId=$("#file_dataId").val();
	var condition = {};
	
	condition.dataId = dataId;
	
	return condition;
}

/**
 * 回调函数
 */
function funcDataFile(){
	$("#tdata_filegrid").datagrid({onClickRow:function(index,row){
	}});
}



/**
 * 下载
 */
function downloadDataFile(){
	var row  = getSelectedRow("#tdata_filegrid");
	if(!row){
		return;
	}
	var link = ctx + "/equipFileData/download?id=" + row.id;
	window.open(link);
}

